<template>
  <u-toast ref="uToast"></u-toast>
</template>
<script>
export default {
  onLaunch: function () {
    // uni.hideTabBar()
    console.log('App Launch');
    // setTimeout(() => {
    // 	uni.setTabBarBadge({
    // 		index: 1,
    // 		// text: '31'
    // 	});
    // 	uni.showTabBarRedDot({
    // 		index: 3
    // 	});
    // }, 1000);
  },
  onShow: function () {
    const _this = this
    console.log('App Show');
    uni.$on('ShowToast', (params) => {
      console.log(123123)
      _this.showToast(params)
    })
  },
  onHide: function () {
    console.log('App Hide');
  },
  methods: {
    showToast(params) {
      console.log(params)
      this.$refs.uToast.show({
        ...params,
        complete() {
          params.url && uni.navigateTo({
            url: params.url
          })
        }
      })
    }
  }
};
</script>
<style lang="scss">
@import "./uni_modules/vk-uview-ui/index.scss";

.content {
  padding: 10px;
}

</style>


